package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.PageDomain;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.service.MemberOrdersService;
import com.zzyl.nursing.vo.NursingProjectPageVo;
import com.zzyl.serve.domain.NursingProject;
import com.zzyl.serve.service.INursingProjectService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import java.util.List;

import static com.zzyl.common.core.domain.AjaxResult.success;

@RestController
@RequestMapping("/member/orders/project")
@Slf4j
public class MemberOrdersController extends BaseController {

    @Resource
    private MemberOrdersService memberOrdersService;

    @Resource
    private INursingProjectService nursingProjectService;

    @GetMapping("/page")
    @ApiOperation("查询护理项目列表")
    public TableDataInfo list(NursingProject nursingProject)
    {
        startPage();
        List<NursingProject> list = nursingProjectService.selectNursingProjectList(nursingProject);
        return getDataTable(list);
    }

    @GetMapping("/{id}")
    public R queryNursingProjectById(@PathVariable Long id){
        return R.ok(memberOrdersService.selectNursingProjectById(id));
    }

}
